import { _decorator, Color, Component, Sprite, SpriteFrame } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Card')
export class Card extends Component {
    @property(Sprite)
    private imgSp: Sprite = null;

    public clickable: boolean = false;


    init(img: SpriteFrame) {
        this.imgSp.spriteFrame = img;
    }

    update() {
        if (this.imgSp) this.imgSp.color = this.clickable ? new Color(255, 255, 255, 255) : new Color(150, 137, 137, 255);
    }

}

